{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport { DECADE_DISTANCE_COUNT, DECADE_UNIT_DIFF } from '.';\nimport PanelBody from \"../PanelBody\";\nexport var DECADE_COL_COUNT = 3;\nvar DECADE_ROW_COUNT = 4;\nfunction DecadeBody(props) {\n  var DECADE_UNIT_DIFF_DES = DECADE_UNIT_DIFF - 1;\n  var prefixCls = props.prefixCls,\n    viewDate = props.viewDate,\n    generateConfig = props.generateConfig;\n  var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n  var yearNumber = generateConfig.getYear(viewDate);\n  var decadeYearNumber = Math.floor(yearNumber / DECADE_UNIT_DIFF) * DECADE_UNIT_DIFF;\n  var startDecadeYear = Math.floor(yearNumber / DECADE_DISTANCE_COUNT) * DECADE_DISTANCE_COUNT;\n  var endDecadeYear = startDecadeYear + DECADE_DISTANCE_COUNT - 1;\n  var baseDecadeYear = generateConfig.setYear(viewDate, startDecadeYear - Math.ceil((DECADE_COL_COUNT * DECADE_ROW_COUNT * DECADE_UNIT_DIFF - DECADE_DISTANCE_COUNT) / 2));\n  var getCellClassName = function getCellClassName(date) {\n    var _ref;\n    var startDecadeNumber = generateConfig.getYear(date);\n    var endDecadeNumber = startDecadeNumber + DECADE_UNIT_DIFF_DES;\n    return _ref = {}, _defineProperty(_ref, \"\".concat(cellPrefixCls, \"-in-view\"), startDecadeYear <= startDecadeNumber && endDecadeNumber <= endDecadeYear), _defineProperty(_ref, \"\".concat(cellPrefixCls, \"-selected\"), startDecadeNumber === decadeYearNumber), _ref;\n  };\n  return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n    rowNum: DECADE_ROW_COUNT,\n    colNum: DECADE_COL_COUNT,\n    baseDate: baseDecadeYear,\n    getCellText: function getCellText(date) {\n      var startDecadeNumber = generateConfig.getYear(date);\n      return \"\".concat(startDecadeNumber, \"-\").concat(startDecadeNumber + DECADE_UNIT_DIFF_DES);\n    },\n    getCellClassName: getCellClassName,\n    getCellDate: function getCellDate(date, offset) {\n      return generateConfig.addYear(date, offset * DECADE_UNIT_DIFF);\n    }\n  }));\n}\nexport default DecadeBody;","map":{"version":3,"names":["_extends","_defineProperty","React","DECADE_DISTANCE_COUNT","DECADE_UNIT_DIFF","PanelBody","DECADE_COL_COUNT","DECADE_ROW_COUNT","DecadeBody","props","DECADE_UNIT_DIFF_DES","prefixCls","viewDate","generateConfig","cellPrefixCls","concat","yearNumber","getYear","decadeYearNumber","Math","floor","startDecadeYear","endDecadeYear","baseDecadeYear","setYear","ceil","getCellClassName","date","_ref","startDecadeNumber","endDecadeNumber","createElement","rowNum","colNum","baseDate","getCellText","getCellDate","offset","addYear"],"sources":["/data/messenger.client/node_modules/rc-picker/es/panels/DecadePanel/DecadeBody.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport { DECADE_DISTANCE_COUNT, DECADE_UNIT_DIFF } from '.';\nimport PanelBody from \"../PanelBody\";\nexport var DECADE_COL_COUNT = 3;\nvar DECADE_ROW_COUNT = 4;\n\nfunction DecadeBody(props) {\n  var DECADE_UNIT_DIFF_DES = DECADE_UNIT_DIFF - 1;\n  var prefixCls = props.prefixCls,\n      viewDate = props.viewDate,\n      generateConfig = props.generateConfig;\n  var cellPrefixCls = \"\".concat(prefixCls, \"-cell\");\n  var yearNumber = generateConfig.getYear(viewDate);\n  var decadeYearNumber = Math.floor(yearNumber / DECADE_UNIT_DIFF) * DECADE_UNIT_DIFF;\n  var startDecadeYear = Math.floor(yearNumber / DECADE_DISTANCE_COUNT) * DECADE_DISTANCE_COUNT;\n  var endDecadeYear = startDecadeYear + DECADE_DISTANCE_COUNT - 1;\n  var baseDecadeYear = generateConfig.setYear(viewDate, startDecadeYear - Math.ceil((DECADE_COL_COUNT * DECADE_ROW_COUNT * DECADE_UNIT_DIFF - DECADE_DISTANCE_COUNT) / 2));\n\n  var getCellClassName = function getCellClassName(date) {\n    var _ref;\n\n    var startDecadeNumber = generateConfig.getYear(date);\n    var endDecadeNumber = startDecadeNumber + DECADE_UNIT_DIFF_DES;\n    return _ref = {}, _defineProperty(_ref, \"\".concat(cellPrefixCls, \"-in-view\"), startDecadeYear <= startDecadeNumber && endDecadeNumber <= endDecadeYear), _defineProperty(_ref, \"\".concat(cellPrefixCls, \"-selected\"), startDecadeNumber === decadeYearNumber), _ref;\n  };\n\n  return /*#__PURE__*/React.createElement(PanelBody, _extends({}, props, {\n    rowNum: DECADE_ROW_COUNT,\n    colNum: DECADE_COL_COUNT,\n    baseDate: baseDecadeYear,\n    getCellText: function getCellText(date) {\n      var startDecadeNumber = generateConfig.getYear(date);\n      return \"\".concat(startDecadeNumber, \"-\").concat(startDecadeNumber + DECADE_UNIT_DIFF_DES);\n    },\n    getCellClassName: getCellClassName,\n    getCellDate: function getCellDate(date, offset) {\n      return generateConfig.addYear(date, offset * DECADE_UNIT_DIFF);\n    }\n  }));\n}\n\nexport default DecadeBody;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,GAAG;AAC3D,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAO,IAAIC,gBAAgB,GAAG,CAAC;AAC/B,IAAIC,gBAAgB,GAAG,CAAC;AAExB,SAASC,UAAU,CAACC,KAAK,EAAE;EACzB,IAAIC,oBAAoB,GAAGN,gBAAgB,GAAG,CAAC;EAC/C,IAAIO,SAAS,GAAGF,KAAK,CAACE,SAAS;IAC3BC,QAAQ,GAAGH,KAAK,CAACG,QAAQ;IACzBC,cAAc,GAAGJ,KAAK,CAACI,cAAc;EACzC,IAAIC,aAAa,GAAG,EAAE,CAACC,MAAM,CAACJ,SAAS,EAAE,OAAO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